1. Relevant Field
Systems and methods consistent with the present invention generally relate to the management of database objects and/or entries. More particularly, systems and methods consistent with the invention relate to the managing data objects by resolving foreign key constraints to process database queries.
2. Background Information
Businesses and other organizations generate and/or receive a variety of entries, data items and electronic information (broadly referred to hereafter as “data objects”) during the course of their operation. These data objects may belong to different classes and may be generated and/or received from various locations in different regions and/or countries. To organize and manage operations of the organization, data objects may be stored in storage devices located in a variety of locations. These storage devices may include relational databases that store the data objects as tables of data, where the tables may consist of rows and columns and may represent relations between the stored data.
The relationships between data objects stored in various database tables may be constrained by using foreign keys. For example, a foreign key may be used to establish and enforce a link between data objects stored in two tables. A foreign key may be a referential constraint between two tables that may identify a column or a set of columns in a referencing database table that may refer to a column or set of columns of a referenced table. Foreign keys may be used to enforce constraints by linking information together and may provide database normalization during processing of database transactions.
During operation, customers or employees of an organization may need to issue queries and process query transactions by using data objects that may be in relational databases. Mainly, an entity may enter a query such as a Structured Query Language (SQL) statement to insert, and/or update, and/or delete one or more data objects from a database. In conventional systems the execution of such a query may fail when a constraint enforced by a foreign key may be violated. Conventional systems, therefore, may execute statements in a particular order and to resolve foreign key constraints before execution of a query.
For example, FIG. 1 illustrates a database system 100, in which database tables 102 and 104 that may be linked together by relationship 106. As is illustrated in FIG. 1, the name of database table 102 may be “EMPLOYEE” such that database table 102 belongs to class “EMPLOYEE” and includes data objects describing information with respect to employees of an organization. The class of a database table may also be referred to as an entity such that each entity may have one database table that may be used to store data objects of the entity. The data objects of an entity may also be referred to as instances of the entity. For example, the columns of database table 102 may include instances “EMPLOYEE ID,” “EMPLOYEE NAME,” “COMPENSATION,” “DEPARTMENT,” and “DUTIES,” of the entity “EMPLOYEE.”
The name of database table 104 may be “EMPLOYEE EVALUATION” such that database table 104 belongs to entity “EMPLOYEE EVALUATION” and includes data objects describing information with respect to evaluations of employees of the organization. The columns of database table 104 may include instances “EVALUATION ID,” “EMPLOYEE ID,” “EMPLOYEE SALES,” “HOURS,” “ATTENDANCE,” and “LAST YEAR RANK” of the entity “EMPLOYEE EVALUATION.” Database table 104 may have a link 106 to database table 102 because there is a relationship between “EMPLOYEE” and “EMPLOYEE EVALUATION.” The “EMPLOYEE ID” column in database table 104 may match the “EMPLOYEE ID” column in database table 102, where the “EMPLOYEE ID” column of database table 102 may be a primary key column 108 of database table 102 and the “EMPLOYEE ID” column of database table 104 may be a foreign key column 110 to database table 102.
Foreign key column 110 may ensure that changes may not be made to data in database table 102 if those changes may invalidate link 106. To process queries or perform query transaction that may require the insertion, deletion, and/or updating of data objects or instances stored in database tables 102 and 104, a constraint enforced by foreign key column 110 may need to be resolved first. Similarly, database tables 102 and 104 may have multiple foreign keys (not shown), and each foreign key constraint may reference a different table. Each foreign key constraint may then be resolved independently by database system 100 and resolution of constraints may require execution of statements in a specific order. Such techniques may require resource intensive computations and may lead to delay in execution of issued queries and SQL statements.
In view of the foregoing, it is desirable to provide methods and systems for reducing the time and computations required to execute queries that may require data objects stored in relational databases. For example, there is a need for improved methods and systems to resolve foreign key constraints more efficiently and by using less resource intensive techniques.